home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1997 February: Technology Seed / Mac Tech Seed Feb '97.toast / ODF Release 3 / ODFDev / ODF / Found / FWString / SLStrRun.xh < prev    next >
Encoding:
Text File  |  1996-12-16  |  4.3 KB  |  189 lines  |  [TEXT/MPS ]

  1.  
  2. /*
  3.  * This file was generated by the SOM Compiler.
  4.  * FileName: SLStrRun.xh.
  5.  * Generated using:
  6.  *     SOM Precompiler somipc: 2.18
  7.  *     SOM Emitter emitxh.dll: 2.33
  8.  */
  9.  
  10. /*
  11.  * 
  12.  * 
  13.  *     File:                SLStrRun.idl
  14.  *     Release Version:    $ ODF 3 $
  15.  * 
  16.  *     Contains:    Interface for OTextRunReader and OTextRunWriter classes
  17.  * 
  18.  *     Copyright:    (c) 1993 - 1996 by Apple Computer, Inc., all rights reserved.
  19.  * 
  20.  * 
  21.  */
  22.  
  23.  
  24. #ifndef SOM_FW_OStringRunWriter_xh
  25. #define SOM_FW_OStringRunWriter_xh
  26.  
  27. class FW_OStringRunWriter;
  28.  
  29. #define FW_OStringRunWriter_MajorVersion 1
  30. #define FW_OStringRunWriter_MinorVersion 0
  31.  
  32. /*
  33.  * Passthru lines: File: "C.xh", "before"
  34.  */
  35.  
  36.  
  37. /* C++ SOM defs */
  38. #include <somcls.xh>
  39. #include <somcm.xh>
  40.  
  41. /* C++ parent defs */
  42. #ifndef SOM_FW_OTextRunWriter_xh
  43. #include <SLTxtRun.xh>
  44. #endif
  45.  
  46. #ifndef FW_OStringRunWriter_API
  47. #define FW_OStringRunWriter_API
  48. /*
  49.  * -- The Class API
  50.  */
  51.  
  52. /*
  53.  * Start of user-defined types:
  54.  */
  55. class SOMClass;
  56. class SOMObject;
  57. class FW_OTextRunReader;
  58. class FW_OTextRunWriter;
  59. class FW_OMemoryRunReader;
  60. class FW_OMemoryRunWriter;
  61. class FW_OStringRunWriter;
  62.  
  63. /*
  64.  * End of user-defined types.
  65.  */
  66.  
  67. #ifdef OLDIBMSOMAPISUPPORT
  68. #define FW_OStringRunWriterCClassData FW_OStringRunWriterClassData
  69. #define FW_OStringRunWriterNewClass(major,minor) somNewVersionedClassReference(FW_OStringRunWriter,major,minor)
  70. #endif
  71.  
  72. /* define xxxMetaClass macro to facilitate (cls ## MetaClass) */
  73. #define FW_OStringRunWriterMetaClass SOMClass
  74.  
  75. #if PRAGMA_ALIGN_SUPPORTED
  76. #  pragma options align=power
  77. #endif
  78.  
  79. /* The API to the FW_OStringRunWriter class object, and the methods it introduces. */
  80. SOMEXTERN struct FW_OStringRunWriterClassDataStructure {
  81. #ifdef OLDIBMSOMAPISUPPORT
  82.     SOMClass            *classObject;    /* always zero, use somNewClassReference instead */
  83. #else
  84.     long zero;
  85. #endif
  86.     somStaticClassInfo *sci;
  87.     somDToken        instanceDataToken;
  88.     long reserved [3];
  89.     somMToken somInit;
  90.     somMToken somUninit;
  91.     somMToken GetCurrentRun;
  92.     somMToken FlushRun;
  93.     somMToken NewRun;
  94.     somMToken Initialize;
  95.     somMToken GetLocale;
  96. } SOMDLINK FW_OStringRunWriterClassData;
  97.  
  98. #if PRAGMA_ALIGN_SUPPORTED
  99. #  pragma options align=reset
  100. #endif
  101.  
  102. #if !defined(FW_OStringRunWriter_Class_Source) && !defined(SOM_Module_slstrrun_Source)
  103. #if PRAGMA_IMPORT_SUPPORTED
  104. #pragma import list FW_OStringRunWriterClassData
  105. #endif
  106. #endif
  107.  
  108.  
  109. /*
  110.  * -- Typedefs and inline method declarations for left path inherited methods
  111.  * -- are omitted because this compilation had -museinheritedmethods in effect
  112.  */
  113.  
  114.  
  115. /*
  116.  * -- Typedefs for FW_OStringRunWriter Method Procedures
  117.  */
  118. SOMEXTERN {
  119. typedef FW_OStringRunWriter*   (* SOMLINK somTD_FW_OStringRunWriter_Initialize)(FW_OStringRunWriter *somSelf, Environment *ev,
  120.         FW_HString theString,
  121.         short bufferSize);
  122. }
  123.  
  124. #endif /* FW_OStringRunWriter_API */
  125.  
  126.  
  127. /*
  128.  * -- This emitter treats Method Tokens as Thunks by default.
  129.  * -- Use the sc modifier "nothunks" to change this default
  130.  */
  131. #undef somresolve_
  132. #define somresolve_(obj,mToken) ((somMethodProc*)((void)obj, mToken))
  133.  
  134. /*
  135.  * -- The C++ Wrapper Class for FW_OStringRunWriter
  136.  */
  137. class FW_OStringRunWriter : public FW_OTextRunWriter
  138. {
  139. public:
  140.  
  141. // FW_OStringRunWriter::new registers use of the class object, and then uses somNew
  142. // to allocate memory and load the object method table pointer. 
  143. void *operator new(size_t size)
  144. {
  145.     SOM_IgnoreWarning(size);
  146.     // Allocate memory using the default allocator for FW_OStringRunWriter, and
  147.     // clear mem & set method table pointer, call basic initialization
  148. #ifdef SOMCHKNULL
  149.     void * __somResult = (void *)
  150.       somNewObject(FW_OStringRunWriter);
  151.     SOMCHKNULL(__somResult);
  152.     return __somResult;
  153. #else
  154.     return (void*) somNewObject(FW_OStringRunWriter);
  155. #endif
  156. }
  157.  
  158. // FW_OStringRunWriter::delete uses the default deallocator for the object's class.
  159. void operator delete(void * obj)
  160. {
  161.     if (obj) {
  162.         SOM_Resolve(obj,SOMObject,somFree)
  163.            ( (SOMObject*) obj );
  164.     }
  165. }
  166.  
  167. /* method: Initialize */
  168. FW_OStringRunWriter*   Initialize(Environment *ev,
  169.         FW_HString theString,
  170.         short bufferSize)
  171. {
  172.    #ifdef SOMCHKEXCEPT
  173.    FW_OStringRunWriter* __somResult = 
  174.       SOM_ResolveD(this,FW_OStringRunWriter,FW_OStringRunWriter,Initialize)
  175.     (this,ev,theString,bufferSize);
  176.       SOMCHKEXCEPT;
  177.    return __somResult;
  178. #else
  179.    return SOM_ResolveD(this,FW_OStringRunWriter,FW_OStringRunWriter,Initialize)
  180.     (this,ev,theString,bufferSize);
  181. #endif
  182. }
  183.  
  184. };   /* FW_OStringRunWriter */
  185.  
  186.  
  187.  
  188. #endif       /* SOM_FW_OStringRunWriter_xh */
  189.